package com.nashuju.web.controller.sw;

import org.durcframework.core.GridResult;
import org.durcframework.core.MessageResult;
import org.durcframework.core.controller.CrudController;
import com.nashuju.web.entity.sw.Log;
import com.nashuju.web.entity.sw.LogSch;
import com.nashuju.web.service.sw.LogService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class LogController extends
		CrudController<Log, LogService> {

		//新增记录
	@RequestMapping("/addLog.do")
	public @ResponseBody
	MessageResult addLog(Log entity) {
		return this.save(entity);
	}

	//删除记录
	@RequestMapping("/delLog.do")
	public @ResponseBody
	MessageResult delLog(Log entity) {
		return this.delete(entity);
	}
	
	//修改记录
	@RequestMapping("/updateLog.do")
	public @ResponseBody
	MessageResult updateLog(Log entity) {
		return this.update(entity);
	}

	//条件查询分页操作
	@RequestMapping("/listLog.do")
	public @ResponseBody
	GridResult listLog(LogSch searchEntitySch) {
		return this.query(searchEntitySch);
	}

	
	//条件查询并返回所有记录
	@RequestMapping("/listAllLog.do")
    public @ResponseBody Object listAllLog(LogSch searchEntitySch) {
        return this.queryAll(searchEntitySch);
    }

    //获取详细信息
	@RequestMapping("/getLogById.do")
    public @ResponseBody Log getLogById(Log entity) {
        return this.getService().get(entity.getId());
    }

 	

}